du=0.0001; Nt=10000; Np=100;
Ustep=10000;
X0=0.1;
A=zeros(Np,Ustep+1);

for i=0:Ustep
	Xt=X0;
    u=i*du;
	for j=1:Nt
		Xt=u*sin(pi*Xt);
	end
	for j=1:Np
		Xt=u*sin(pi*Xt);
		A(j,i+1)=Xt;
	end;
end;

BiFugure=figure;
set(BiFugure,'Units','centimeters','Position',[4 1 25 15]);
for i=1:Np
	plot(0:du:du*Ustep,A(i,:),'.b','MarkerSize',1);
	hold on;
end;
title('Bifurcation Diagram for X_{n+1}=u\timessin(pi\timesX_n)');
xlabel('u');
ylabel('Attractors');